package com.guigu.www.tangyingmeng.controller;

import com.guigu.www.pojo.BespeakResult;
import com.guigu.www.pojo.HealthManager;
import com.guigu.www.pojo.PageVo;
import com.guigu.www.pojo.PersonClassification;
import com.guigu.www.tangyingmeng.service.TymBespeakResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/result")
public class TymBespeakResultController {

    @Autowired
    private TymBespeakResultService service;

    @PostMapping("/selresultall")
    public PageVo<BespeakResult> selresultall (@RequestBody Map<String, String> map) {
        PageVo<BespeakResult> pageVo = service.selresuleall(map);
        return pageVo;
    }

    @GetMapping("/selresultone/{id}")
    public BespeakResult selresultone (@PathVariable("id")Integer id ) {
        BespeakResult result = service.selresultone(id);
        return result;
    }

    @GetMapping("/selpersonall")
    public List<PersonClassification> selpersonall () {
        List<PersonClassification> list = service.selpersonall();
        return list;
    }

    @GetMapping("/selhealthall")
    public List<HealthManager> selhealthall () {
        List<HealthManager> list = service.selhealthall();
        return list;
    }

    @PostMapping("/queren")
    public Boolean queren (@RequestBody BespeakResult result) {
        return service.queren(result);
    }
}
